package com.tjetc.ioc.test;

import com.tjetc.aop.Vehicle;
import com.tjetc.ioc.config.AppConfig;
import com.tjetc.ioc.dao.UserDao;
import com.tjetc.ioc.service.UserService;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author gaoyongxiang
 * @version v1.0
 * @date 2025/9/2
 */
public class _4TestSpring implements BeanPostProcessor {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        Vehicle vehicle = context.getBean(Vehicle.class);
        System.out.println(vehicle.getClass());
        vehicle.run();
        vehicle.f();
    }

    public static void main2(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println(userDao.getClass());
    }



}